﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Reference.aspx.cs" Inherits="Habito.Admini.Reference" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server"><title>Reference</title>
    <script type="text/javascript" src="../../Scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery.jbind.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery.treeTable.js"> </script>
    <script src="../../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Scripts/jquery.FixedHeadTable.js"> </script>
    <script src="../Scripts/common.js" type="text/javascript"></script>
    <link href="../../Content/jquery.treeTable.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/easyui.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(document).ready(function () {
            $.ajax({
                cache: false,
                url: window.location.href + "?GetAllReference=1",
                success: function (data) {
                    data = $.evalJSON(data);
                    $("#logList").treeTable({
                        treeColumn: -1,
                        key: "ID",
                        bind: {
                            templateID: "#logList_bt",
                            data: data,
                            ajaxPara: {},
                            ajaxSuccess: function (re) { }
                        }
                    });
                }
            });
        });

        function AddNew() {
            location.href("ReferenceEdit.aspx?id=0");
        }

        function deleteReference(id) {
            if (confirm("Confirm delete this product message?")) {
                $.ajax({
                    cache: false,
                    data: { id: id },
                    url: window.location.href + "?DeleteReference=1",
                    success: function (aaa) {
                        if (aaa == "True") {
                            alert("Product message has deleted");
                            $("#logList").ttGetItem(id).ttRemove();
                        }
                    }
                });
            }
        }
    </script>
</head>
<body>
    <div style="float: left; width: 98%; overflow: auto;">
        <table id="logList" style="width: 630px;">
            <thead>
                <tr>
                    <th style="width: 90px">
                        <a href="#" onclick="AddNew()">Add</a>
                    </th>
                    <th>Year</th>
                    <th>Project Name</th>
                    <th>City</th>
                    <%--<th>Description</th>--%>
                </tr>
                <tr id='logList_bt' style="display: none">
                    <td>
                        <a href="ReferenceEdit.aspx?id={ID}">Modify </a>
                        <a href="#" onclick="deleteReference('{ID}')">Delete</a></td>
                    <td>{RYear}</td>
                    <td>{ProjectName}</td>
                    <td>{City}</td>
                    <%--<td>{Description}</td>--%>
                </tr>
            </thead>
        </table>
    </div>
</body>
</html>
